The present invention relates to a semiconductor device, a functional safety system and a program and, in particular, relates to, the semiconductor device, the functional safety system and the program configured to perform, for example, data storage.
In recent years, in functional safety of industrial equipment, automobile products and so forth, a soft error (temporary data content corruption) that would occur in a memory, a flip flop and so forth caused by alpha rays, neutron rays and so forth has become an issue.
Detection by using test data, detection by using a double RAM (Random Access Memory) algorithm and detection by using an ECC (Error Check and Correct) function are given as methods of detecting the soft error of the memory in Japanese Unexamined Patent Application Publication No. 2012-104064. Here, in the detection by using the test data, when predetermined test data is written into the RAM concerned and thereafter read-out data does not match the original test data, an operation of detecting the above-mentioned situation as the soft error is periodically repeated. In the detection by using the double RAM algorithm, in actual data accessing, actual data is written into a designated address and data of the form that all bits of the actual data have been inverted is written into an address of the form that the designated address has been inverted. Then, when the read-out actual data is compared with the inverted data and the actual data does not match the inverted data, this situation is detected as the soft error. In addition, the detection by using the ECC function is detection of the soft error by using an ECC function that is attached to a RAM module.
However, in the detection by using the test data, since data is read out shortly after the data has been written and it is confirmed whether the read-out data matches the original data, a probability of collision of radioactive rays (including secondary cosmic rays) is low and acquisition of a sufficient soft error detection rate is not expected. In addition, time is taken for saving and restoring the actual data in the memory and for detecting the soft error and therefore performance degradation of the system is induced. In addition, the detection by using the ECC function has such disadvantages that it is difficult to adopt the detection using the ECC function for a RAM that has no ECC function as hardware, a processing load is high in software and therefore implementation of the software is difficult.
In addition, Japanese Unexamined Patent Application Publication No. 2013-109532 discloses that in data writing, predetermined data is written into data areas in three different formats in order to perform soft error detection and data recovery. Here, the first data is raw data (writing object data), the second data is inverted data of the writing object data, and the third data is data obtained by performing a bitwise operation on the writing object data and predetermined data.